package com.example.SpringBootRestful.controller;


import com.example.SpringBootRestful.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class UserController {

    @Autowired
    public UserService userService;
    @GetMapping("/api/users")
    @CrossOrigin()

    public ResponseEntity getALLUser() {return new ResponseEntity<>(userService.getAllUser(), HttpStatus.OK);}
}
